home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / _impulse / ImpulseDoc / Text / Impulse3 < prev    next >
Text File  |  1992-05-07  |  28KB  |  475 lines

  1. Impulse II
  2.  
  3. A high-level application control system for RISC OS.  The system is given the name Impulse II because it contains many of the ideas used in the original version of Impulse.
  4.  
  5. Impulse II is a system of passing messages between tasks to command them to do things not normally possible using the defined Wimp messages.  The messages contain simple textual commands so that they can be set up easily by the user - bringing him the ability to use his powerful application programs in new ways.
  6.  
  7. The Impulse II system will be used to implement mail-merging in Impression and hot-links between programs such as Equasor, Impression, ShowPage and others.  It will also be used by small utilities such as !Measure and timed auto-save/auto-backup, etc.  In the future ABIáII (our new 3D User-Interface Management System) will use Impulse messages to transfer information between applications and their user-interfaces.  When ABI II is in use, our applications will become completely general-purpose servers which do nothing more than service requests to manipulate their objects.
  8.  
  9. The syntax of Impulse commands is defined to be future-proof.  Although the commands defined at the moment are quite simple, they will be able to support object-oriented programming, resource protection by capabilities, distributed systems, etc...  You will already see some of the terminology of object-oriented programming used in this document.  True object-orientation is not yet defined in the Impulse system (in particular the concept of classes) but it will be formalised in the future.
  10.  
  11. A small RISC OS application will be written to allow the user to directly type in and send Impulse commands around the system.  This will take the form of a scrolling text window in which commands are typed and replies are shown.  It is intended that, one day, there will exist a program which adds a shell of looping keywords, conditional keywords and variables around the Impulse message commands so that Impulse scripts can be run.
  12.  
  13. We will make Impulse II public domain and we would like to see Impulse become established as the RISCáOS inter-application communication standard.  Any comments or suggestions on the proposed ssystem are welcomed.
  14.  
  15.  
  16. Command syntax
  17. Command strings syntax is:
  18.     Command ::= ObjectPath MethodName Parameters
  19.     ObjectPath ::= Empty | : ObjectName | : " Objectname "
  20.     ObjectName ::= Empty | Identifier [ . Identifier ]
  21.     MethodName ::= Identifier
  22.     Identifier ::= < ASCII 33 .. ASCII 255 >
  23.     Empty ::=
  24. The syntax of the parameters is defined by the server.
  25.  
  26.  
  27. ObjectPaths
  28. ObjectPaths are paths from the current machine to the object on which the method is to be performed. If the first Identitifer in the ObjectPath matches the name of another machine Impulse will send the message to that machine.  If the first Identifier in the ObjectPath does not match the name of another machine Impulse assumes that the path specifies an object on the local machine.
  29.  
  30. Some example ObjectPaths,
  31. Impression.MergeLet    This object path can have two meanings. It either specifies document "MergeLet" in application "Impression" on the local machine, or if the local machine is connected to another called "Impression", the commad will be sent to an application called "MergeLet" on that machine!
  32. $.Paint5        Specifies application "Paint5" on the local machine.
  33. Fred.Squirrel.Users    If the local machine is connected to another named "Fred" then this path specifies document "Users" in application "Squirrel" on machine "Fred".
  34.  
  35. The $ symbol is used to specify the local machine.  It is used to force Impulse to try to resolve the object path only locally to that machine.  Obviously, if the machine is not connected to any others the $ symbol doesn't need to be used at all!
  36. The ObjectPath is not always needed in command strings.  When the command is being broadcast to all applications on a machine it can be ommitted.  Also, the client and server tasks can agree a protocol which allows the client to refer to the object it wants to use by name once only and from then on use a faster, more compact object reference.  (Such a protocol for use by all applications will be defined by us at a later date!)
  37.  
  38. Methods
  39. The operations that servers can perform on behalf of the client are called methods.  Servers give their methods textual names to be used in command strings.  The Impulse module decodes commands for the server telling it which method is being called but it is the responsibility lfe server to extract parameters from commands.  The commands are intended to be entered by ordinary users, not programmers, and so their design should be very simple.  The method names should attempt to describe what they do.
  40. Proposed mail merge commands
  41.     Merge
  42.     ClearMerge
  43.  
  44. Proposed general commands
  45.     Save
  46.     Print
  47.     Edit On | Off
  48.     Create
  49.     Destroy
  50.  
  51. Proposed Impulse commands
  52.     ImpulseDescribeMethods
  53.     ImpulseDescribeClasses
  54.  
  55. Possible database commands
  56.     GetField <Integer>
  57.     If <expression> Then ... Else ...
  58.  
  59. Some example command strings
  60. :$.Impression.Letter23 DoMerge
  61. :Impression.Letter23 Edit Off
  62. :$.Squirrel.Customers  If Field(1)="Mr" Then ="His" Else ="Her"
  63. :International.Egypt.Tut_Co_Ltd.DirectorsNet.Simbal StarServer "WIPE *.* FR"
  64. FontDirChanged
  65.  
  66. The possible replies to these command messages also take the form of strings but no machine name or method names are included - just return parameters.
  67.  
  68. The size of the Impulse messages are constrained by the size of the Acorn message block, ie. 256 bytes minus the size of the header, hence only limited parameters can be passed in the original command message.  Longer parameters follow in further messages. The original command message and its reply must always be readable by humans, ie. it is always textual.  The longer parameters can be passed in any form - they are not expected to be readable by humans.
  69.  
  70.  
  71. Remote method calls
  72. As described above the ObjectPaths allow for the message to be sent off the local machine to other machines connected to it.  This is made possible by tasks called Link Servers which register themselves with Impulse in the normal way.  Each one controls the hardware/software link between the local machine and one or more other machines.
  73.  
  74. For example, consider the Econet link server.  It will register itself to Impulse with the name öEconetò, so any ObjectPath which starts ö:Econet.ò will be sent to the Econet link server.  The message will be sent on the network to the machine specified by the unresolved part of the ObjectPath.  When the message is received from the network by the link server on the receiving machine, it adjusts the message before sending it on that machine by calling Impulse_SendMessage.
  75.  
  76. Note that if a message has been transferred over one network to a machine which is connected to another the ObjectPath in the message could cause the message to be sent on the second network.  Thus the machine connected to both networks automatically becomes a gateway between them for Impulse messages without any special ögatewayò software being used.
  77.  
  78. It is entirely up to the local Econet link server and those on the other machines to control the naming of machines/users and to make network communications efficient.  The link servers would typically broadcast machine names and user names to each other at regular intervals so that each link server can send Impulse messages directly to the machine that they are intended for.
  79.  
  80. For more details on link servers see the section öImplementing Link Serversò.
  81.  
  82.  
  83. Impulse II message format
  84. Two message action codes are defined, Command and Reply.  They are very similar in format and both Impulse II messages will, of course, have the normal Acorn message header.
  85.  
  86. The format of the command message is (with r1 pointing at the base of the message):
  87.     R1+16    #Message_ImpulseCommand
  88.     R1+20    Flags
  89.     R1+24    Offset to command string from message base (n)
  90.     R1+28    Offset to unresolved part of ObjectPath from first character of ObjectPath
  91.     R1+32    Estimated size of data in bytes
  92.     ...
  93.     R1+n    Command string
  94.  
  95. The format of the reply message is (with r1 pointing at the base lfe message):
  96.     R1+16    #Message_ImpulseReply
  97.     R1+20    Flags
  98.     R1+24    Offset to command string from message base (n)
  99.     R1+28    Reserved - must be zero
  100.     R1+32    Estimated size of data in bytes
  101.     ...
  102.     R1+n    Reply string
  103.  
  104. The Flags word and offset word are provided for future expansion lfe message format.
  105. The bits in the flags word have the following meanings:
  106.     Bit    Meaning when set
  107.     0    Close channel after message
  108.     31    Error (Only meaningful in reply messages)
  109. All other flags will be set to zero but tasks should not assume that they are zero when receiving messages.
  110.  
  111. The Offset word allows other data to be included in the message.  At the moment the command string will usually start at byte 32, directly after the Resolution word, but tasks should not assume this position!
  112.  
  113. The Resolution word points into the ObjectPath to show which part of it has yet to be resolved, if it exists.  The name pointed to by the Resolution word represents the next place where the command will be sent.  Once a command has been sent to a server task the Resolution word will point to the name of the object (if there is one) within the server to which the command should apply.
  114.  
  115.  
  116. Impulse II message protocol
  117. The message passing protocols take the form of request-reply pairs between client and server tasks.  The client (the task sending request messages) will perform these operations:
  118.  
  119.     Send command message;        {Setting DataEstimate if wanting to send data}
  120.     if command.DataEstimate<>0 then
  121.     begin
  122.         while more data do
  123.         begin
  124.             Await RAMFetch;
  125.             Wimp_BlockTransfer;
  126.             Send RAMTransmit;
  127.         end; {while}
  128.     end; {if DataEstimate<>0}
  129.     if need reply then
  130.     begin
  131.         Await reply;
  132.         if reply.DataEstimate<>0 and want data then
  133.         repeat
  134.             Send RAMFetch;
  135.             Await RAMTransmit;
  136.         until no more to fetch;
  137.     end; {if need reply}
  138.  
  139. Note that the client does not actually wait for any replies unless it wants to and that one conversation can transfer large amounts of data in both directions.
  140.  
  141. The data transmission is carried out using protocols already defined by Acorn for in-memory transfer.  The command messages need not be sent to specific tasks, they can be broadcast.
  142.  
  143. When sending commands it is important not to assume that replies will come back before other events occur.  Although messages have a high priority in the Wimp and are returned in preference to all other types of event, the reply to an Impulse command may have to come back from a remote machine and the delay before it arrives could be considerable.
  144.  
  145. Tasks will not need to worry about most of this protocol!  The Impulse II module will provide SWIs to send requests and deal with replies and the associated transfer of data.
  146.  
  147. This system allows programs issuing Impulse commands to be completely ignorant lfe content of the commands.  If a task dealing with Impulse messages receives a reply or data transfer message that it does not want to process (maybe it has no data to send or does not wish to receive the incoming data) it simply ignores the message.  This will cause an "undelivered" message to be returned to the sender and he will abort the operation without complaint.
  148.  
  149.  
  150.  
  151.  
  152.  
  153. Impulse II module
  154. A RISC OS module will be provided to help applications use the Impulse II system.  The module will decode incoming messages and send messages for the application.  To allow the Impulse module to decode incoming Impulse messages the application will supply it with a table describing methods which it implements.
  155.  
  156. Note that the following descriptions of SWI calls describe the module as it stands at the time of writing and they may change before the module is released.
  157.  
  158. The SWI descriptions given below apply to Impulse module version 0.17.
  159.  
  160. Impulse_Initialise
  161. (SWI &428C0)
  162.  
  163. Announces that a task is going to be an Impulse server or client.
  164.  
  165. On entry    R0 = last Impulse version number known to task * 100
  166. R1 = task handle of caller (as returned by Wimp_Initialise)
  167. R2 = pointer to application name
  168. R3 = -1
  169.  
  170. On exit    R0 = current Impulse version number * 100
  171. R1-R3 preserved
  172.  
  173. Interrupts    Interrupts are enabled
  174. Fast interrupts are enabled
  175.  
  176. Processor mode    Processor is in SVC mode
  177.  
  178. Re-entrancy        SWI is not re-entrant
  179.  
  180. Use    This call registers the task as being an Impulse user - eiher a client or a server.  It also ensures that the task's name has not already been registered by another task.
  181.  
  182. Impulse_Initialise should only be called once when the task starts up.  It must be called after "Wimp_Initialise" has been called and before any other call to the Impulse module is made.
  183.  
  184. Obviously, a program cannot be an Impulse client or server without being a Wimp task or else it would not receive any Impulse messages.
  185.  
  186. Related SWIs    None
  187.  
  188. Related vectors    None
  189. Impulse_Decode
  190. (SWI &428C1)
  191.  
  192. Decodes Impulse messages into unique tokens.
  193.  
  194. On entry    R0 = reason code (from Wimp_Poll)
  195. R1 = pointer to block (from Wimp_Poll, data depends on reason code)
  196. R5 = pointer to method structure
  197. R6 = task handle of caller (as returned by Wimp_Inititialise)
  198.  
  199. On exit    R0 = reason code
  200.     or &200 if Impulse command message received
  201.     or &201 if Impulse request message received
  202.     or &202 if Impulse reply message received
  203.     or &203 if Impulse RAMFetch received
  204.     or &204 if Impulse RAMTransmit received
  205.     or -1 if message was dealt with
  206. R1 = pointer to block (data depends on reason code)
  207. If R0 = &200,&201  (Impulse_Command or Impulse_Request) then
  208.     R5 = method token
  209.     R6 = ptr to parameter results after OS_ReadArgs or ptr to params or -1
  210.     R7 = pointer to object name string
  211. If R0 = &202 (Impulse_Reply) then
  212.     R5 = reply tag or -1 if it's an unexpected reply
  213.     R6 = pointer to reply string or -1 if no reply was sent
  214. If R0 = &203 (Impulse_SendData) then
  215.     R5 = reply tag
  216.     R7 = Max. size of data that should be sent
  217. If R0 = &204 (Impulse_ReceiveData) then
  218.     R5 = reply tag
  219.     R6 = Size of data expected
  220.     R7 = Size of data that was sent
  221.  
  222. Interrupts    Interrupts are enabled
  223. Fast interrupts are enabled
  224.  
  225. Processor mode    Processor is in SVC mode
  226.  
  227. Re-entrancy        SWI is not re-entrant
  228.  
  229. Use    This call traps incoming Impulse II messages and deals with them for the task.  It must be called if a task is going to use Impulse for any reason!  It directs incoming replies on to the appropriate routines and decodes the method name from the command string into a unique number.  Only Poll_Wimp events 17, 18 and 19 are trapped, so the task can call Impulse_Decode only when one of those events has been received.  This ensures that the other event handlers (the Null event handler in particular) are called as quickly as possible.
  230.  
  231. When an Impulse message is sent to the task, this SWI captures it and checks that the machine name is correct - if not the message is ignored.  It then decodes the method name against those supplied in the method structure.
  232.  
  233. The method structure format is:
  234.     Structure format word (always 0 at the moment)
  235.  
  236. Followed by any number of the following records:
  237.     Method information flags (always 0)
  238.     Method token
  239.     Method name string, zero terminated
  240.     Parameter syntax string, zero terminated
  241.     Align to word
  242.  
  243. Terminated by:
  244.     Invalid flags word (-1)
  245.     Invalid method token (-1)
  246.     Null method name (""+CHR$0)
  247.     Null parameter syntax string (""+CHR$0)
  248.     Align to word
  249.  
  250. The method name strings must not contain ASCII character code 127 or any codes lower than 33.  The matching of method names in the structure against method name in the messages is not case sensitive.  In cases where one method name is the root of another, for example, "Get" and "GetField", the shortest one should appear last in the method structure.
  251.  
  252. The syntax strings are used by the Impulse module to call OS_ReadArgs to deal with the command parameters.  See the description lf that SWI, pp. 597-600 of PRM volume II for more information.
  253. The method token is the number passed back to the caller in R5 if the command message is succesfully parsed by Impulse.
  254.  
  255. If the event passed to Impulse_Decode is not an Impulse message then the register values from Wimp_Poll are returned unaltered.  If the event was an Impulse message then the reason code is altered to be one lfe Impulse event reason codes &200 to &205.
  256. To handle these new reason codes tasks should simply do something like this:
  257.  
  258. .PollLoop
  259.     mov    r0,#0        ; Allow all events
  260.     add    r1,r12,#PollBuff    ; Point to data buffer
  261.     swi    "Wimp_Poll"    ; Wait for an event
  262.     cmp    r0,#17        ; If it's a message
  263.     adrhs    r5,MethodTable    ; Then get method table addr
  264.     ldrhs    r6,[r12,#TaskID]    ; and get my task handle
  265.     swihs    "Impulse_Decode"    ; and give Impulse a look
  266.     bl    PollEvent    ; Go deal with event
  267.     bal    PollLoop        ; Go around again...
  268.  
  269. ; This subroutine dispatches events to their handlers.
  270. .PollEvent
  271.     cmp    r0,#&200        ; If Reason code is valid
  272.     bhs    ImpulseEvent
  273.     ...    ...        ...
  274. ; Normal Wimp event handling here...
  275.  
  276. .ImpulseEvent
  277.     sub    r0,r0,#&200
  278.     cmp    r0,#&205-&200
  279.     addls    pc,pc,r0,asl #2    ; Then jump to handler
  280.     movs    pc,r14        ; >&205 (Invalid reason)
  281. ; The following events are generated by Impulse_Decode...
  282.     bal    ImpulseMethod    ; &200 (Impulse_Command)
  283.     bal    ImpulseMethod    ; &201 (Impulse_Request)
  284.     bal    ImpulseReply    ; &202 (Impulse_Reply)
  285.     bal    ImpulseSend    ; &203 (Impulse_SendData)
  286.     bal    ImpulseReceive    ; &204 (Impulse_ReceiveData)
  287.     movs    pc,r14    ; &205 (Impulse_DefferedReply)
  288.  
  289. If the event passed to Impulse_Decode is a message which is handled by the module but does not contain a command (eg. RAMFetch, RAMTransmit or an undelivered message) then the event reason code returned will be -1.  If the jump table is set up as described above this will jump through the invalid reason code handler.
  290.  
  291. Impulse_Command    The returned block contains an Impulse Command message as described Impulse_Request    above.  When these reason codes are returned then R5 is either set to the appropriate token from the method structure or -1 if there was some sort of syntax error in the command.
  292.  
  293. R6 points to the parameter block output by calling OS_ReadArgs on the parameter string using the syntax string from the method structure.  If no syntax string was supplied then R6 points to the parameter string itself.  R6 is -1 if the call to OS_ReadArgs resulted in an error.
  294.  
  295. R7 points to the local object name within the server.  This will be a null string if no local object name was supplied.  If the command string includes the optional ObjectPath then Impulse will already have resolved any machine names and the name of the server by the time it is passed to the server via one lf these events.  The remaining part of the ObjectPath must therefore refer to an object controlled by the server and it should make sure that the local object name is valid before performing the method.  When R7 points to a null string the server should treat the method as applying to itself rather than an object within it.
  296.  
  297. Impulse_Reply    When an Impulse reply is received it is passed on to the user via reason code &202 (Impulse_Reply).  R5 holds the value of the reply tag which was passed to Impulse_SendMessage so that the task can identify which request the reply belongs to.  If the reply was not originally sent by that task calling Impulse_SendMessage R5 contains -1.
  298.  
  299. Impulse_SendData    The returned block contains a RAMFetch message as described in the PRMs although the program should not need to look at it.
  300. This event is returned when a RAMFetch message is received as part of an Impulse conversation between client and server tasks.  The program should respond to the event by sending a chunk of data back to the other task using SWI Impulse_TransmitData.
  301.  
  302. Impulse_ReceiveData    The returned block contains a RAMTransmit message as described in the PRMs - but the program should not need to use it.
  303. This event is returned when a RAMTransmit message is received as part of an Impulse conversation between client and server tasks.  The program should respond by checking to see if its buffer was filled by the transmitted data (if r6=r7) and if so, it should call SWI Impulse_FetchData to request any remaining data from the other task.
  304.  
  305. Related SWIs    None
  306.  
  307. Related vectors    None
  308. Impulse_SendMessage
  309. (SWI &428C2)
  310.  
  311. Build and send an Impulse message on behalf of a client task.
  312.  
  313. On entry    R0 = reason code (&200-&205)
  314. R1 = pointer to command or reply string
  315. R2,R3 = destination task description (as Wimp_SendMessage)
  316. R4 = impulse message flags
  317. R5 = reply tag
  318. R6 = task handle
  319. R7 = estimated size of data to follow this message
  320.  
  321. On exit    R0 is preserved
  322. R1 = pointer to message block
  323. R2 = task handle of destination (except for broadcasts)
  324. R4 = MyRef of message sent if a reply is expected to returned in response
  325.  
  326. Interrupts    Interrupts are enabled
  327. Fast interrupts are enabled
  328.  
  329. Processor mode    Processor is in SVC mode
  330.  
  331. Re-entrancy        SWI is not re-entrant
  332.  
  333. Use    This call builds and sends an Impulse command message.  Its parameters are similar to Wimp_SendMessage except for some small differences.  Only a limited range of reason codes are accepted in R0, all others will be faulted:
  334.  
  335. Code    Meaning
  336. &200    Impulse_Command (send command, no reply expected)
  337.     Needs: R0, R1, R2, R3, R6, R7
  338. &201    Impulse_Request (send comand, reply expected)
  339.     Needs: R0, R1, R2, R3, R5, R6
  340. &202    Impulse_Reply (send reply to last command)
  341.     Needs: R0, R1, R5, R6, R7
  342. &205    Impulse_DefferedReply (send reply to last Impulse_DeferReply)
  343.     Needs: R0, R1, R5, R6
  344.  
  345. R1 does not point to a message block on entry, instead it points at the string which the SWI builds into a suitable message block.  On exit, however, the pointer to the message block that was built is returned so that the caller can, if needed, inspect the header fields.
  346.  
  347. The reply tag in R5 is used to identify the reply when it is returned to the task via Impulse_Decode.  The Impulse module stores the my_ref field of the message along with the tag and Impulse_Decode uses this information to detect incoming replies by matching their your_ref fields against the stored references.  The values of tags and their use are entirely up to the caller.
  348.  
  349. R7 gives the estimated amount of data to follow the message. Setting R7 to zero means that the caller does not wish to send any data after this message.  When R7 is non-zero the caller is telling whoever receives the message that it would like to transfer some data following this message.  If the receiver is able to receive the data then Impulse_SendData events will be generated to transfer the data across.  The caller may transfer more data than the amount given in the original estimate.
  350.  
  351. Codes &200 and &201
  352. The destination task description in r2 and r3 is as described in the PRMs, it can specify the message to be sent to a particular task, broadcast to all tasks, sent to the owner of window or the owner of an icon on the icon bar.  The reply tag is not checked to see if it has been used before!  This allows you to give different messages the same reply tag.
  353.  
  354. Code &202 & &205
  355. When calling Impulse_SendMessage with reason code &202 (Impulse_Reply) the reply is automatically sent to the task which sent the last command received.  The your_ref field of the reply is automatically set up from the last command.  Note that this means that you must send any reply to a command before calling Wimp_Poll again.  If you need to call Wimp_Poll before you can reply to the last message then you must postpone the reply using Impulse_DeferReply.
  356.  
  357. When calling Impulse_SendMessage with reason code &205 (Impulse_DefferedReply) the reply is sent to the task whose message was being processed when Impulse_DeferReply was called.
  358.  
  359. Related SWIs    None
  360.  
  361. Related vectors    None
  362.  
  363.  
  364. Impulse_TransmitData
  365. (SWI &428C3)
  366.  
  367. Send an Impulse data message on behalf of a client or server task.
  368.  
  369. On entry    R0 = pointer to base lf data block to send
  370. R1 = pointer to top of data block to send
  371. R6 = task handle
  372.  
  373. On exit    R4 = myRef reference of the RAMTransmit message just sent
  374.  
  375. Interrupts    Interrupts are enabled
  376. Fast interrupts are enabled
  377.  
  378. Processor mode    Processor is in SVC mode
  379.  
  380. Re-entrancy        SWI is not re-entrant
  381.  
  382. Use    This call is used to send data to another task - usually as part of the handling code for an Impulse_SendData event during data transfer to another task.  The Impulse_SendData event signals that the task receiving data is ready for more data to be sent to it.  The sending task should prepare its data for transmission and call Impulse_TransmitData to send it.  Impulse_TransmitData will then call Wimp_TranferBlock, build the appropriate RAMTransmit message and send it back to the receiving task.
  383.  
  384. The header of the RAMTransmit message is built by looking at the last Impulse message received and so Impulse_TransmitData must be called before the next Wimp_Poll.
  385.  
  386. Note that, at the moment, the sender must ensure that the size of data he sends is less than or equal to the buffer size supplied in the fetch message.
  387.  
  388. Both this call and Impulse_FetchData, described below, leave the handling lfe data buffers for sending and receiving data to the calling task.  This enables tasks to do clever things like transforming data as they send it or to increase the size of data buffers as data is received.
  389.  
  390. Related SWIs    None
  391.  
  392. Related vectors    None
  393. Impulse_FetchData
  394. (SWI &428C4)
  395.  
  396. Receive an Impulse data message on behalf of a client or server task and send any following messages to get more data.
  397.  
  398. On entry    R0 = pointer to base of data buffer for more data
  399. R1 = pointer to top of data buffer for more data
  400. R6 = task handle
  401.  
  402. On exit    R4 = myRef reference field of the message just sent
  403.  
  404. Interrupts    Interrupts are enabled
  405. Fast interrupts are enabled
  406.  
  407. Processor mode    Processor is in SVC mode
  408.  
  409. Re-entrancy        SWI is not re-entrant
  410.  
  411. Use    This call sends a request for more data to the sending task - usually as part lfe code handling an Impulse_ReceiveData event.  It builds and sends a RAMFetch message to the sending task to request more data to be placed in the specified buffer.
  412.  
  413. The header of the RAMFetch message is built by looking at the last Impulse message received and so Impulse_FetchData must be called before the next Wimp_Poll.
  414.  
  415. Related SWIs    None
  416.  
  417. Related vectors    None
  418.  
  419. Impulse_CloseDown
  420. (SWI &428C5)
  421.  
  422. Tell Impulse that a client or server task is about to die.
  423.  
  424. On entry    R0 = task handle returned by Wimp_Initialise
  425.  
  426. On exit    ÿ
  427.  
  428. Interrupts    Interrupts are enabled
  429. Fast interrupts are enabled
  430.  
  431. Processor mode    Processor is in SVC mode
  432.  
  433. Re-entrancy        SWI is not re-entrant
  434.  
  435. Use    This call should be made just before Wimp_CloseDown is called.  It tells Impulse to remove all records lfe task from its tables and to tidy up any outstanding conversations with other tasks.
  436.  
  437. Related SWIs    None
  438.  
  439. Related vectors    None
  440.  
  441. Impulse_DeferReply
  442. (SWI &428C6)
  443.  
  444. Postpone a reply message being sent.
  445.  
  446. On entry    ÿ
  447.  
  448. On exit    ÿ
  449.  
  450. Interrupts    Interrupts are enabled
  451. Fast interrupts are enabled
  452.  
  453. Processor mode    Processor is in SVC mode
  454.  
  455. Re-entrancy        SWI is not re-entrant
  456.  
  457. Use    When a task does not respond to a request event by replying before the next call to Wimp_Poll a negative acknowledgement event is normally sent to the task which made the request.  However, this is not always useful because the replying task may need to call Wimp_Poll several times before it can send the reply.  In these circumstances Impulse_DeferReply can be used to prevent the negative acknowledgement until the task is ready to reply.  When the task is ready to reply, it should call Impulse_SendMessage with reason code Impulse_DefferedReply.
  458.  
  459. Only one reply can be deffered at a time!
  460.  
  461. Related SWIs    None
  462.  
  463. Related vectors    None
  464.  
  465. Implementing Link Servers
  466.  
  467. There are complications involved in writing link servers due to the way that Acorn Wimp messages work.  Firstly, negative acknowledgments are normally returned to the sender of a message if the receiver does not reply befoer he next calls Wimp_Poll.  Secondly, the my_ref and your_ref fields are only unique on local machine - they will quite possibly be duplicated on other machines.
  468.  
  469. The link server will probably send its messages across the network in the background while the Wimp continues to multi-task and so it must return to Wimp_Poll before any reply is received to a message sent over the network.  To avoid a negative acknowledgement event in the client task, the link server must defer the reply...
  470.  
  471. The link server must modify the my_ref and your_ref fields of messages received from other machines so that they are unique on the local machine.  It must also be able to map the your_ref field of any reply message so that it will be correct when the reply is returned to the sedning machine.
  472.  
  473. ....
  474.  
  475.